﻿using Microsoft.Xna.Framework;
using GameLibrary;
using Rescue_of_the_Dwarvenzombies.SceneObjects.SceneObjectsHandlers;

namespace Rescue_of_the_Dwarvenzombies.SceneObjects.GameObjects.Characters.Enemies
{
    internal class Zombie : Enemy
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Zombie"/> class.
        /// </summary>
        /// <param name="enemyHandler">The enemy handler.</param>
        /// <param name="itemHandler">The item handler.</param>
        /// <param name="position">The position.</param>
        public Zombie(IEnemyObserver enemyHandler, IEnemyObserver itemHandler, Vector2 position)
            : base(enemyHandler, itemHandler, position)
        {
            InitZombieAttributes();
        }

        /// <summary>
        /// Inits the zombie attributes.
        /// </summary>
        private void InitZombieAttributes()
        {
            Health = Constant.ZOMBIE_HEALTH;
            ItemDropRate = Constant.ZOMBIE_DROPRATE;
            TextureName = Constant.ZOMBIE_TEXTURE_NAME;
            Damage = Constant.ZOMBIE_DAMAGE;
            Velocity = Constant.ZOMBIE_VELOCITY;
            RateOfFire = Constant.ZOMBIE_RATE_OF_FIRE;
            SourceRectangle = new Rectangle(0, 0, Constant.ZOMBIE_RECTANGLE_WIDTH, Constant.ZOMBIE_RECTANGLE_HEIGHT);
            RectangleHeight = Constant.ZOMBIE_RECTANGLE_HEIGHT;
            RectangleWidth = Constant.ZOMBIE_RECTANGLE_WIDTH;
            RectangleOffsetX = Constant.ZOMBIE_RECTANGLE_OFFSET_X;
            RectangleOffsetY = Constant.ZOMBIE_RECTANGLE_OFFSET_Y;
            TotalTextureWidth = Constant.ZOMBIE_TOTAL_TEXTURE_WIDTH;
            Score = Constant.ZOMBIE_SCORE;
            BoundingBox = new BoundingBox(new Vector3(Position.X, Position.Y, 0), new Vector3(Position.X + RectangleWidth, Position.Y + RectangleHeight, 0));
            TintColor = Color.White * 0.0f;
        }
    }
}